import Home from "../views/Home";
import Web from "../views/Home/Web";
import Config from "../views/Home/Config";
import Test from "../views/Home/Test";
import System from "../views/Home/System";
import Sensor from "../views/Home/Sensor";

import Neo from "../views/Neo";
import Console from "../views/Neo/Console";

import Error from "../views/error/defined";

const routers = [
  {
    path: '/',
    element: <Home />, // 使用 element 而不是 component
    children: [ // 小写 children
      {
        index: true, // 默认子路由，当访问 '/' 时显示
        element: <Web />
      },
      {
        path: 'web', // 访问 '/web'
        element: <Web />
      },
      {
        path: 'config', // 访问 '/config'
        element: <Config />
      },
      {
        path: 'test', // 访问 '/config'
        element: <Test />
      },
      {
        path: 'system', // 访问 '/config'
        element: <System />
      },
      {
        path: 'sensor', // 访问 '/config'
        element: <Sensor />
      }
    ]
  },
    {
    path: '/neo',
    element: <Neo />, // 使用 element 而不是 component
    children: [ // 小写 children
      {
        index: true, // 默认子路由，当访问 '/' 时显示
        element: <Console />
      },
    ]
  },
  {
    path: '*',
    element: <Error />
  }
];

export default routers;